package com.xy.deepclone;




/**
 * @author 谢阳
 * @version 1.8.0_131
 * @date 2022/6/10 14:44
 * @description
 */
public class Client {
    public static void main(String[] args) {
        Sheep sheep1 = new Sheep("tom", 1, "白色");
        sheep1.friend = new Sheep("jack", 2, "黑色");
        Sheep sheep2 = sheep1.clone();

        System.out.println("克隆羊是否为同一只:" + (sheep2 == sheep1));
        // 对象为浅拷贝
        System.out.println("克隆羊的朋友是否为同一只:" + (sheep2.friend == sheep1.friend));
    }
}
